<?php $this->load->module('mobile/index/header', $common);?>
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/dialog.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/index.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/line.css" />

<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/mobilecommon.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/slider.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/dialog.js"></script>
<div class="content">

    <form action="" class="listForm" method="post">
        <article class="bottom_c" id="payInfo">
            <?php if($identity=='1'):?>
            <section style="position: relative;">
                <span class="password fl" style="width:4em">用户名</span>
                    <span class="fRight fl">
                        <input name="name" placeholder="用户名" type="text" value="<?php echo $name ;?>">
                    </span>
            </section>
            <?php endif ;?>

            <?php if($identity=='2'):?>
            <section style="position: relative;">
                <span class="password fl" style="width:4em">昵称</span>
                <span class="fRight fl">
                    <input name="name" placeholder="昵称" type="text" value="<?php if(!empty($name)) echo $name ;?>">
                </span>
            </section>

            <section style="position: relative;">
                <span class="password fl" style="width:4em">姓名</span>
                    <span class="fRight fl">
                        <input name="realname" placeholder="姓名" type="text" value="<?php if(!empty($info['realname'])) echo $info['realname'] ;?>">
                    </span>
            </section>
            <?php endif ;?>
            <section style="position: relative;">
                <span class="password fl" style="width:4em">手机</span>
                    <span class="fRight fl">
                        <input name="mobile" placeholder="<?php echo $info['mobile']?>" type="text" value="<?php if(!empty($info['mobile'])) echo $info['mobile'] ;?>" readonly />
                    </span>
            </section>

            <section style="position: relative;">
                <span class="password fl" style="width:4em">性别</span>
                    <span class="fRight fl">
                        <input type="radio" name="gender" value="1" checked="checked"/>男
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="radio" name="gender" value="2" <?php if($info['gender']=='2'):?>checked="checked"<?php endif;?> />女
                    </span>
            </section>

        </article>
        <div class="col_div">
            <a href="javascript:void(0);" class="btn btn-blue" title="修改">修改</a>
        </div>
    </form>
</div>

<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    function alert_popup(text){
        $.dialog({
            style:'tip',
            width:200,
            closeTime:500,
            content: '<p style="text-align: center">'+text+'</p>'
        }).open();
    }
$(function(){

    $('.btn').click(function(){
        if($('input[name="name"]').val().length == 0){
            alert_popup('请输入昵称');
            return false;
        }
        var name = $('input[name="name"]').val();
        var gender = $('input[name="gender"]:checked').val();
        $.post('<?php echo $form_url ;?>',{
            name: name,
            gender: gender
        },function(data){
            if(data.status=='1')
            {
                window.location.reload() ;
            }
            alert_popup(data.info);
            return false;
        },'json')
    })

})
</script>